<!--//=========================<script réaliser par :MEZOUARI KHALID>===================-->
{extends file="skulton.tpl"}{/extends}
{block name="monblock"}


<script src="scripts/js/Form.js"></script>
<script>

$(function() {
    
    $( "#dialog-form" ).dialog({
      autoOpen: false,
      height: 400,
      width: 500,
      modal: true,
      buttons: {
      },
      close: function() {
        allFields.val( "" ).removeClass( "ui-state-error" );
      }
    });

    $( ".modifier_compteRendu" )
      .button()
      .click(function() {
        $( "#dialog-form" ).dialog( "open" );
      });
      
          $( "#form_ajouter" ).dialog({
      autoOpen: false,
      height: 400,
      width: 500,
      modal: true,
      buttons: {
      },
      close: function() {
        allFields.val( "" ).removeClass( "ui-state-error" );
      }
    });
      
      $( "#Ajouter" )
      .button()
      .click(function() {
        $( "#form_ajouter" ).dialog( "open" );
      });
  });

</script>

<script type="text/javascript" charset="utf-8">
  var asInitVals = new Array();
   
  $(document).ready(function() {
  
  
  // Dialogue
  $('.modifier_compteRendu').click(function(){
      var a= $('.id',this);
      var id= $(a[0]).text();
      $("#id").val(id);
      a= $('.designation',this);
      var designation= $(a[0]).text();
      $("#designation").val(designation);
      
      a= $('.description',this);
      var description= $(a[0]).text();
      $("#description").val(description);
      
      a= $('.piece',this);
      var piece= $(a[0]).text();
      $("#piece").val(piece);
      $("#dialog-form").html($("<img>").attr("src",piece));
      a= $('.dateFin',this);
      var dateFin= $(a[0]).text();
      $("#dateFin").val(dateFin);
      
      a= $('.fonction',this);
      var fonction= $(a[0]).text();
      $("#fonction").val(fonction);
      
      
      
      
        
      
    
    });
    
      
     // Fin dialogue

      $(".yesno").click(function(){
        var a = $(this);
        $( "#dialog-confirm" ).dialog({
            resizable: false,
            modal: true,
            buttons: {
              "Oui": function() {
                
                document.location.href="compteRendu.php?id_sup="+a.attr('id');
              },
              "Non": function() {
                $( this ).dialog( "close" );
              }
            }
        });
      });
  
  
  
  
  
    var oTable = $('#idtable').dataTable( {
      "sPaginationType": "full_numbers",
      "oLangudateFin": {
        "sSearch": "Rechercher:"
      }
    } );
     
     
    //recherche spécifique à la colone
    $("tfoot input").keyup( function () {
      /* Filter on the column (the index) of this element */
      oTable.fnFilter( this.value, $("tfoot input").index(this) );
    } );
     
     
     
    /*
     * Support functions to provide a little bit of 'user friendlyness' to the textboxes in
     * the footer
     */
    $("tfoot input").each( function (i) {
      asInitVals[i] = this.value;
    } );
     
    $("tfoot input").focus( function () {
      if ( this.className == "search_init" )
      {
        this.className = "";
        this.value = "";
      }
    } );
     
    $("tfoot input").blur( function (i) {
      if ( this.value == "" )
      {
        this.className = "search_init";
        this.value = asInitVals[$("tfoot input").index(this)];
      }
    } );
    
    
      
      // FORMULAIRE UI
      
      
      
      
    
  } );
</script>



    
<div class="content-box"><!-- Start Content Box -->
  
  <div class="content-box-header">
    
    <h3>Liste des compteRendus Réalisées</h3>
    
    <!-- Formulaire -->
    
    <div class="clear"></div>
    
  </div> <!-- End .content-box-:>header -->
  <div class="content-box-content">
        
      </div> <!-- End #messdateFins -->

    <div class="tab-content default-tab" id="tab1"> <!-- This is the target div. id must match the href of this div's tab -->
    {if isset($messdateFin)}
      <div class="notification success png_bg">
        <a href="#" class="close"><img src="imdateFins/icons/cross_grey_small.png" title="Close this notification" alt="close"></a>
        <div>
          {$messdateFin}
        </div>
      </div>
    {/if} 
      
  <div style="display:none;" id="dialog-confirm" title="Demande de confirmation">
    <p><span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"></span>Voulez-vous vraiment supprimer cet enregistrement ?</p>
  </div>

  
     <table id="idtable">
        
        <thead>
          <tr>
             <th><input class="check-all" type="checkbox" /></th>
              <th>id</th>
             <th>Désignation</th>
             <th>Description</th>
             <th>Date Fin</th>
             <th>opération</th>
             
          </tr>
          
        </thead>
      
       
        <tbody>
          {foreach $return as $compteRendu}
          <tr>
            <td><input type="checkbox" /></td>
            <td>{$compteRendu->getIdCompteRendu()}</td>
            <td>{$compteRendu->getDesignation()}</td>
            <td>{$compteRendu->getDescription()}</td>
            <td>{$compteRendu->getDateFin()}</td>
            <!--<td>{$compteRendu->getIdNomade()}</td>-->
            
            <td>
              <!-- Icons -->
               <a href="#dialog-form" class="modifier_compteRendu" ><img src="images/icons/pencil.png" alt="Edit"  />
                <span class="id" style="display:none">{$compteRendu->getIdCompteRendu()}</span><!--utile pour manipuler les valeurs dans jquery lfog-->
                <span class="designation" style="display:none">{$compteRendu->getDesignation()}</span>
                <span class="description" style="display:none">{$compteRendu->getDescription()}</span>
                <span class="piece" style="display:none">{$compteRendu->getPiece()}</span>
                <span class="dateFin" style="display:none">{$compteRendu->getDateFin()}</span>
               </a> 
                <a href="#" title="Delete" class="yesno with-tip supp" id="{$compteRendu->getIdCompteRendu()}"><img src="images/icons/cross.png" alt="Delete" /></a>
              
            </td>
          </tr>
          {/foreach}
          
          
        </tbody>
        
        <tfoot>
          <tr>
            <th><input type="text" name="search_id" value="" class="search_int" style="display:none" /></th>
            <th><input type="text" name="search_id" value="" class="search_int" style="display:none" /></th>
            <th><input type="text" name="search_designation" value="" class="search_int" /></th>
            <th><input type="text" name="search_description" value="" class="search_int"  /></th>
            <th><input type="text" name="search_piece" value="" class="search_int"  /></th>
            <th><input type="text" name="search_dateFin" value="" class="search_int"  /></th>
            
          </tr>
        </tfoot>
        
      </table>
      
      
      <div id="dialog-form" title="Visualiser photo" class="reformed-form"> <!-- MessdateFins are shown when a link with these attributes are clicked: href="#messdateFins" rel="modal"  -->
           
        
      </div> 

    </div> <!-- End #tab2 -->        
    
  </div> <!-- End .content-box-content -->

 {/block}